$(window).load(function() {
    $(".loading").fadeOut()
});
var data = [
    {"name":"圳味餐厅","amount":486,"type":"抖音团购"},
    {"name":"钱大妈","amount":50,"type":"微信支付"},
    {"name":"百香鲜果园","amount":70,"type":"支付宝"},
    {"name":"金丰粮油","amount":35,"type":"微信支付"},
    {"name":"足三里","amount":256,"type":"抖音团购"},
    {"name":"兴海湾烤肉馆","amount":120,"type":"微信支付"},
    {"name":"果然美甘草水果","amount":78,"type":"微信支付"},
    {"name":"菜老包","amount":80,"type":"支付宝"},
    {"name":"谊品卤菜","amount":118,"type":"支付宝"},
    {"name":"费大厨辣椒炒肉","amount":235,"type":"微信支付"},
    {"name":"巴奴毛肚火锅","amount":360,"type":"抖音团购"},
    {"name":"嘟云健康国医馆","amount":198,"type":"抖音团购"},
    {"name":"禾山有素","amount":88,"type":"微信支付"},
    {"name":"老常德土菜馆","amount":155,"type":"支付宝"},
    {"name":"新亨粿条水工面","amount":32,"type":"微信支付"},
    {"name":"湛江烤生蚝","amount":99,"type":"微信支付"},
    {"name":"天下牛社牛羊骨肉","amount":128,"type":"抖音团购"},
    {"name":"爱耳乐采耳","amount":89,"type":"微信支付"},
    {"name":"大自然醉鹅","amount":199,"type":"抖音团购"},
    {"name":"微豪私厨","amount":260,"type":"支付宝"},
    {"name":"鸿途食味轩","amount":112,"type":"微信支付"},
    {"name":"朵恋鲜花","amount":50,"type":"微信支付"},
    {"name":"五指毛桃香鸡","amount":61,"type":"微信支付"},
    {"name":"八号牛扒","amount":171,"type":"抖音团购"},
    {"name":"袁记云饺","amount":30,"type":"支付宝"},
    {"name":"海底捞火锅","amount":655,"type":"抖音团购"},
    {"name":"元初食品","amount":76,"type":"微信支付"},
    {"name":"聚友烧吧","amount":97,"type":"支付宝"},
    {"name":"麦基潮汕火锅","amount":111,"type":"微信支付"},
    {"name":"客家牛杂","amount":119,"type":"微信支付"},
    {"name":"悦馨养生足浴SPA","amount":150,"type":"抖音团购"},
    {"name":"音轨琴行","amount":60,"type":"微信支付"},
    {"name":"日兴百货","amount":120,"type":"支付宝"},
    {"name":"欧零造型","amount":50,"type":"微信支付"},
    {"name":"黑明餐厅","amount":33,"type":"微信支付"},
    {"name":"闽北风味馆","amount":134,"type":"微信支付"},
    {"name":"治甜糖水铺","amount":67,"type":"支付宝"},
    {"name":"局口拌面","amount":30,"type":"微信支付"},
    {"name":"头号抓手","amount":67,"type":"微信支付"},
    {"name":"一叶舟小火锅","amount":181,"type":"支付宝"},
    {"name":"里间咖啡","amount":53,"type":"抖音团购"},
    {"name":"吴姐鲜果园","amount":82,"type":"微信支付"},
    {"name":"兮目美眸美甲","amount":269,"type":"抖音团购"},
    {"name":"小龙坎流水席","amount":235,"type":"抖音团购"},
    {"name":"尊宝披萨","amount":38,"type":"支付宝"},
    {"name":"千户之屋","amount":120,"type":"微信支付"},
    {"name":"小渔村美食城","amount":72,"type":"支付宝"},
    {"name":"稻香村川菜","amount":38,"type":"微信支付"},
    {"name":"一味海鲜小炒","amount":97,"type":"微信支付"},
    {"name":"醉品轩","amount":69,"type":"支付宝"},
    {"name":"天海特色餐厅","amount":55,"type":"微信支付"},
    {"name":"东北烧烤","amount":49,"type":"支付宝"},
    {"name":"大将深夜小食堂","amount":73,"type":"支付宝"},
    {"name":"鸟鹏烧鸟居酒屋","amount":162,"type":"微信支付"},
    {"name":"荣记豆腐","amount":36,"type":"微信支付"},
    {"name":"三两粉","amount":30,"type":"微信支付"},
    {"name":"沙县小吃","amount":25,"type":"支付宝"},
    {"name":"梅须里双人套餐","amount":499,"type":"抖音团购"},
    {"name":"79号渔船海鲜饭店","amount":253,"type":"微信支付"},
    {"name":"观澜山水田园","amount":158,"type":"微信支付"},
    {"name":"黄三大排档","amount":98,"type":"微信支付"},
    {"name":"海鲜汤与金针牛","amount":238,"type":"抖音团购"},
    {"name":"九堡鸡生蚝火锅","amount":82,"type":"微信支付"},
    {"name":"溢香酒楼","amount":70,"type":"支付宝"},
    {"name":"华清源健康养生会","amount":189,"type":"微信支付"},
    {"name":"鸟生鱼汤","amount":169,"type":"抖音团购"},
    {"name":"归云处私房菜","amount":98,"type":"支付宝"},
    {"name":"二人烧","amount":107,"type":"微信支付"},
    {"name":"木粉酒馆","amount":118,"type":"微信支付"},
    {"name":"肥真牛火锅","amount":80,"type":"微信支付"},
    {"name":"食欲老院子","amount":95,"type":"支付宝"},
    {"name":"中潜潜水世界","amount":335,"type":"抖音团购"},
    {"name":"解家河南菜","amount":121,"type":"支付宝"},
    {"name":"老六农家菜","amount":70,"type":"支付宝"},
    {"name":"庭院人家","amount":155,"type":"微信支付"},
    {"name":"嘻哈哈辣香锅","amount":60,"type":"微信支付"},
    {"name":"就八桌火锅","amount":102,"type":"微信支付"},
    {"name":"瓦库茶","amount":154,"type":"支付宝"},
    {"name":"隐野食堂","amount":129,"type":"微信支付"},
    {"name":"汤悦温泉","amount":267,"type":"支付宝"},
    {"name":"曼玉餐厅","amount":98,"type":"支付宝"},
    {"name":"京者三文鱼","amount":108,"type":"微信支付"},
    {"name":"闪聚烧烤酒场","amount":92,"type":"微信支付"},
    {"name":"上上签老火锅","amount":118,"type":"支付宝"},
    {"name":"稻香园","amount":228,"type":"抖音团购"},
    {"name":"棒咖啡音乐餐吧","amount":75,"type":"微信支付"},
    {"name":"老闵田螺馆","amount":78,"type":"支付宝"},
    {"name":"水一方健康水会","amount":163,"type":"微信支付"},
    {"name":"何家会砂锅饭","amount":30,"type":"微信支付"},
    {"name":"柴火鱼","amount":80,"type":"微信支付"},
    {"name":"龙门地烤","amount":73,"type":"支付宝"},
    {"name":"巷子里的辣子鸡","amount":63,"type":"支付宝"},
    {"name":"双喜印象","amount":139,"type":"微信支付"},
    {"name":"山丫丫土家菜","amount":43,"type":"微信支付"},
    {"name":"陈府襄阳菜","amount":315,"type":"抖音团购"},
    {"name":"阿五黄河大鲤鱼","amount":129,"type":"支付宝"},
    {"name":"海韵养生会所","amount":347,"type":"抖音团购"},
    {"name":"城墙根茶馆","amount":180,"type":"微信支付"},
    {"name":"忠福酒店","amount":668,"type":"微信支付"}
];
// 总数
function getTotal(){
    var timestamp2023 = (new Date("2023/11/16")) / 1000; //2023年的时间戳
    var timestamp_now = (new Date()) / 1000; //现在的时间戳
    return parseInt((2000000000 - 101566060.91) * (timestamp_now - timestamp2023) / 315360) / 100 + 101566060.91;
}

// 算法函数：今日开卡
function todayOpen(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 1054 + parseInt((timestamp_now - timestamp_today) / 86400 * ( 3500 - 1054 ));
}

// 算法函数：卡券发放
function CardSend(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 10056 + parseInt((timestamp_now - timestamp_today) / 86400 * ( 20000 - 10056 ));
}

// 算法函数：二次营销
function SecondSale(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 3560 + parseInt((timestamp_now - timestamp_today) / 86400 * ( 7000 - 3560 ));
}

// 算法函数：最近12天
function Recent12(){
    let timestamp_now = (new Date()) / 1000 - 11 * 86400; //11天前的时间戳
    let array0 = [];
    for (let index = 0; index < 12; index++) {
        let date = new Date(1000*(timestamp_now+86400*index));
        array0.push((date.getMonth()<10?"0":"")+(date.getMonth()+1)+"/"+(date.getDate()<10?"0":"")+date.getDate());
    }
    console.log(array0);
    return array0;
}

// 算法函数：会员卡消费
function UserUse(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 3007894 + parseInt((timestamp_now - timestamp_today) / 86400 * ( 5000000 - 3007894));
}

// 算法函数：会员卡充值
function UserStorage(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 2000054 + parseInt((timestamp_now - timestamp_today) / 86400 * ( 4000000 - 2000054));
}

// 算法函数：支付计算（微信元）
function Zhifu1_1(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 0 + parseInt((timestamp_now - timestamp_today) / 86400 * 1900006000) / 100;
}

// 算法函数：支付计算（微信笔）
function Zhifu1_2(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 0 + parseInt((timestamp_now - timestamp_today) / 86400 * 450000);
}

// 算法函数：支付计算（支付宝元）
function Zhifu2_1(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 0 + parseInt((timestamp_now - timestamp_today) / 86400 * 1000006000) / 100;
}

// 算法函数：支付计算（支付宝笔）
function Zhifu2_2(){
    let date = new Date();
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    let timestamp_today = (new Date(date.getFullYear()+"/"+(date.getMonth()+1)+"/"+date.getDate())) / 1000; //今天的时间戳
    return 0 + parseInt((timestamp_now - timestamp_today) / 86400 * 250000);
}

// 算法函数：覆盖商家数
function Shangjia(){
    var timestamp2023 = (new Date("2023/01/01")) / 1000; //2023年的时间戳
    var timestamp_now = (new Date()) / 1000; //现在的时间戳
    return parseInt((100000 - 41254) * (timestamp_now - timestamp2023) / 31536000) + 41254;
}

// 定时器10秒钟
function ReFresh(){
    $(".numtxt").html(getTotal().toFixed(2));
    $(".huiyuanka-1 span").html(UserUse());
    $(".huiyuanka-2 span").html(UserStorage());
    $(".wz-number-1 span").first().html(Zhifu1_1().toFixed(2));
    $(".wz-number-1 span").last().html(Zhifu1_2());
    $(".wz-number-2 span").first().html(Zhifu2_1().toFixed(2));
    $(".wz-number-2 span").last().html(Zhifu2_2());
}

$(function() {
    let x = "";
    let timestamp_now = (new Date()) / 1000; //现在的时间戳
    $.each(data,function(index,item){
        let date = new Date((timestamp_now - 65 - index * 266 - parseInt(Math.random() * 20)) * 1000);
        x = (date.getMonth()<10?"0":"")+(date.getMonth()+1)+"/"+(date.getDate()<10?"0":"")+date.getDate()+" "+(date.getHours()<10?"0":"")+date.getHours()+":"+(date.getMinutes()<10?"0":"")+date.getMinutes()+":"+(date.getSeconds()<10?"0":"")+date.getSeconds();

        $("#listbody").append("<tr><td>"+item.name+"</td><td style='float:right;margin-right:36px;'>"+item.amount+"</td><td>"+x+"</td><td>"+item.type+"</td></tr>");
    });
    ReFresh();
    setInterval(function(){ReFresh();},5000);
    echarts_1();
    echarts_2();
    echarts_3();
//  echarts_4();
    echarts_40();
    echarts_5();
    zb1();
    zb2();
    zb3();

     function echarts_1() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('echart1'));
         option = {
             tooltip: {
                 trigger: 'item',
                 formatter: "{b} : {c} ({d}%)"
             },
             legend: {
                 right: 0,
                 top: 30,
                 height: 160,
                 itemWidth: 10,
                 itemHeight: 10,
                 itemGap: 10,
                 textStyle: {
                     color: 'rgba(255,255,255,.6)',
                     fontSize: 12
                 },
                 orient: 'vertical',
                 data: ['商业', '酒店', '娱乐', '餐饮', '美业']
             },
             calculable: true,
             series: [{
                 name: ' ',
                 color: ['#1210ff', '#ff0089', '#ffc002', '#9a08fd', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#7562c9', '#c96262', '#c25775', '#00b7be'],
                 type: 'pie',
                 radius: [30, 70],
                 center: ['35%', '50%'],
                 roseType: 'radius',
                 label: {
                     normal: {
                         show: true
                     },
                     emphasis: {
                         show: true
                     }
                 },

                 lableLine: {
                     normal: {
                         show: true
                     },
                     emphasis: {
                         show: true
                     }
                 },

                 data: [{
                         value: 10,
                         name: '商业'
                     },
                     {
                         value: 5,
                         name: '酒店'
                     },
                     {
                         value: 15,
                         name: '娱乐'
                     },
                     {
                         value: 25,
                         name: '餐饮'
                     },
                     {
                         value: 20,
                         name: '美业'
                     },

                 ]
             }, ]
         };

         // 使用刚指定的配置项和数据显示图表。
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function echarts_2() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('echart2'));

         option = {
             tooltip: {
                 trigger: 'item',
                 formatter: "{b} : {c} ({d}%)"
             },
             legend: {

                 top: '15%',
                 data: ['图例1', '图例2', '图例3', '图例4', '图例5'],
                 icon: 'circle',
                 textStyle: {
                     color: 'rgba(255,255,255,.6)',
                 }
             },
             calculable: true,
             series: [{
                 name: '',
                 color: ['#62c98d', '#2f89cf', '#4cb9cf', '#53b666', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#c96262'],
                 type: 'pie',
                 //起始角度，支持范围[0, 360]
                 startAngle: 0,
                 //饼图的半径，数组的第一项是内半径，第二项是外半径
                 radius: [51, 100],
                 //支持设置成百分比，设置成百分比时第一项是相对于容器宽度，第二项是相对于容器高度
                 center: ['50%', '45%'],

                 //是否展示成南丁格尔图，通过半径区分数据大小。可选择两种模式：
                 // 'radius' 面积展现数据的百分比，半径展现数据的大小。
                 //  'area' 所有扇区面积相同，仅通过半径展现数据大小
                 roseType: 'area',
                 //是否启用防止标签重叠策略，默认开启，圆环图这个例子中需要强制所有标签放在中心位置，可以将该值设为 false。
                 avoidLabelOverlap: false,
                 label: {
                     normal: {
                         show: true,
                         //  formatter: '{c}辆'
                     },
                     emphasis: {
                         show: true
                     }
                 },
                 labelLine: {
                     normal: {
                         show: true,
                         length2: 1,
                     },
                     emphasis: {
                         show: true
                     }
                 },
                 data: [{
                         value: 1,
                         name: '图例1',
                     },
                     {
                         value: 4,
                         name: '图例2',
                     },
                     {
                         value: 5,
                         name: '图例3',
                     },
                     {
                         value: 6,
                         name: '图例4',
                     },
                     {
                         value: 9,
                         name: '图例5',
                     },
                     {
                         value: 0,
                         name: "",
                         label: {
                             show: false
                         },
                         labelLine: {
                             show: false
                         }
                     },
                     {
                         value: 0,
                         name: "",
                         label: {
                             show: false
                         },
                         labelLine: {
                             show: false
                         }
                     },
                     {
                         value: 0,
                         name: "",
                         label: {
                             show: false
                         },
                         labelLine: {
                             show: false
                         }
                     },
                     {
                         value: 0,
                         name: "",
                         label: {
                             show: false
                         },
                         labelLine: {
                             show: false
                         }
                     },
                     {
                         value: 0,
                         name: "",
                         label: {
                             show: false
                         },
                         labelLine: {
                             show: false
                         }
                     },


                 ]
             }]
         };

         // 使用刚指定的配置项和数据显示图表。
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function echarts_3() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('echart3'));

         option = {
             tooltip: {
                 trigger: 'axis',
                 axisPointer: {
                     lineStyle: {
                         color: '#57617B'
                     }
                 }
             },
             legend: {

                 //icon: 'vertical',
                 data: ['销售额', '利润'],
                 //align: 'center',
                 // right: '35%',
                 top: '0',
                 textStyle: {
                     color: "#fff"
                 },
                 // itemWidth: 15,
                 // itemHeight: 15,
                 itemGap: 20,
             },
             grid: {
                 left: '0',
                 right: '20',
                 top: '10',
                 bottom: '20',
                 containLabel: true
             },
             xAxis: [{
                 type: 'category',
                 boundaryGap: false,
                 axisLabel: {
                     show: true,
                     textStyle: {
                         color: 'rgba(255,255,255,.6)'
                     }
                 },
                 axisLine: {
                     lineStyle: {
                         color: 'rgba(255,255,255,.1)'
                     }
                 },
                 data: Recent12()
             }, {




             }],
             yAxis: [{
                 axisLabel: {
                     show: true,
                     textStyle: {
                         color: 'rgba(255,255,255,.6)'
                     }
                 },
                 axisLine: {
                     lineStyle: {
                         color: 'rgba(255,255,255,.1)'
                     }
                 },
                 splitLine: {
                     lineStyle: {
                         color: 'rgba(255,255,255,.1)'
                     }
                 }
             }],
             series: [{
                 name: '销售额',
                 type: 'line',
                 smooth: true,
                 symbol: 'circle',
                 symbolSize: 5,
                 showSymbol: false,
                 lineStyle: {
                     normal: {
                         width: 2
                     }
                 },
                 areaStyle: {
                     normal: {
                         color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                             offset: 0,
                             color: 'rgba(24, 163, 64, 0.3)'
                         }, {
                             offset: 0.8,
                             color: 'rgba(24, 163, 64, 0)'
                         }], false),
                         shadowColor: 'rgba(0, 0, 0, 0.1)',
                         shadowBlur: 10
                     }
                 },
                 itemStyle: {
                     normal: {
                         color: '#cdba00',
                         borderColor: 'rgba(137,189,2,0.27)',
                         borderWidth: 12
                     }
                 },
                 data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122]
             }, {
                 name: '利润',
                 type: 'line',
                 smooth: true,
                 symbol: 'circle',
                 symbolSize: 5,
                 showSymbol: false,
                 lineStyle: {
                     normal: {
                         width: 2
                     }
                 },
                 areaStyle: {
                     normal: {
                         color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                             offset: 0,
                             color: 'rgba(39, 122,206, 0.3)'
                         }, {
                             offset: 0.8,
                             color: 'rgba(39, 122,206, 0)'
                         }], false),
                         shadowColor: 'rgba(0, 0, 0, 0.1)',
                         shadowBlur: 10
                     }
                 },
                 itemStyle: {
                     normal: {
                         color: '#277ace',
                         borderColor: 'rgba(0,136,212,0.2)',
                         borderWidth: 12
                     }
                 },
                 data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
             }]
         };

         // 使用刚指定的配置项和数据显示图表。
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function echarts_4() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('echart4'));
         option = {
             tooltip: {
                 trigger: 'axis',
                 axisPointer: {
                     lineStyle: {
                         color: '#57617B'
                     }
                 }
             },
             "legend": {

                 "data": [{
                         "name": "图例1"
                     },
                     {
                         "name": "图例2"
                     },
                     {
                         "name": "完成率"
                     }
                 ],
                 "top": "0%",
                 "textStyle": {
                     "color": "rgba(255,255,255,0.9)" //图例文字
                 }
             },

             "xAxis": [{
                 "type": "category",

                 data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                 axisLine: {
                     lineStyle: {
                         color: "rgba(255,255,255,.1)"
                     }
                 },
                 axisLabel: {
                     textStyle: {
                         color: "rgba(255,255,255,.6)",
                         fontSize: '14',
                     },
                 },

             }, ],
             "yAxis": [{
                     "type": "value",
                     "name": "金额",
                     "min": 0,
                     "max": 50,
                     "interval": 10,
                     "axisLabel": {
                         "show": true,

                     },
                     axisLine: {
                         lineStyle: {
                             color: 'rgba(255,255,255,.4)'
                         }
                     }, //左线色

                 },
                 {
                     "type": "value",
                     "name": "完成率",
                     "show": true,
                     "axisLabel": {
                         "show": true,

                     },
                     axisLine: {
                         lineStyle: {
                             color: 'rgba(255,255,255,.4)'
                         }
                     }, //右线色
                     splitLine: {
                         show: true,
                         lineStyle: {
                             color: "#001e94"
                         }
                     }, //x轴线
                 },
             ],
             "grid": {
                 "top": "10%",
                 "right": "30",
                 "bottom": "30",
                 "left": "30",
             },
             "series": [{
                     "name": "图例1",

                     "type": "bar",
                     "data": [4, 6, 36, 6, 8, 6, 4, 6, 30, 6, 8, 12],
                     "barWidth": "auto",
                     "itemStyle": {
                         "normal": {
                             "color": {
                                 "type": "linear",
                                 "x": 0,
                                 "y": 0,
                                 "x2": 0,
                                 "y2": 1,
                                 "colorStops": [{
                                         "offset": 0,
                                         "color": "#609db8"
                                     },

                                     {
                                         "offset": 1,
                                         "color": "#609db8"
                                     }
                                 ],
                                 "globalCoord": false
                             }
                         }
                     }
                 },
                 {
                     "name": "图例2",
                     "type": "bar",
                     "data": [
                         4, 2, 34, 6, 8, 6, 4, 2, 32, 6, 8, 18
                     ],
                     "barWidth": "auto",

                     "itemStyle": {
                         "normal": {
                             "color": {
                                 "type": "linear",
                                 "x": 0,
                                 "y": 0,
                                 "x2": 0,
                                 "y2": 1,
                                 "colorStops": [{
                                         "offset": 0,
                                         "color": "#66b8a7"
                                     },
                                     {
                                         "offset": 1,
                                         "color": "#66b8a7"
                                     }
                                 ],
                                 "globalCoord": false
                             }
                         }
                     },
                     "barGap": "0"
                 },
                 {
                     "name": "完成率",
                     "type": "line",
                     "yAxisIndex": 1,

                     "data": [100, 50, 80, 30, 90, 40, 70, 33, 100, 40, 80, 20],
                     lineStyle: {
                         normal: {
                             width: 2
                         },
                     },
                     "itemStyle": {
                         "normal": {
                             "color": "#cdba00",

                         }
                     },
                     "smooth": true
                 }
             ]
         };


         // 使用刚指定的配置项和数据显示图表。
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function echarts_5() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('echart5'));
         // 颜色
         var lightBlue = {
             type: 'linear',
             x: 0,
             y: 0,
             x2: 0,
             y2: 1,
             colorStops: [{
                 offset: 0,
                 color: 'rgba(41, 121, 255, 1)'
             }, {
                 offset: 1,
                 color: 'rgba(0, 192, 255, 1)'
             }],
             globalCoord: false
         }

         var option = {
             tooltip: {
                 show: false
             },
             grid: {
                 top: '0%',
                 left: '65',
                 right: '14%',
                 bottom: '0%',
             },
             xAxis: {
                 min: 0,
                 max: 100,
                 splitLine: {
                     show: false
                 },
                 axisTick: {
                     show: false
                 },
                 axisLine: {
                     show: false
                 },
                 axisLabel: {
                     show: false
                 }
             },
             yAxis: {
                 data: ['字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称'],
                 //offset: 15,
                 axisTick: {
                     show: false
                 },
                 axisLine: {
                     show: false
                 },
                 axisLabel: {
                     color: 'rgba(255,255,255,.6)',
                     fontSize: 14
                 }
             },
             series: [{
                 type: 'bar',
                 label: {
                     show: true,
                     zlevel: 10000,
                     position: 'right',
                     padding: 10,
                     color: '#49bcf7',
                     fontSize: 14,
                     formatter: '{c}%'

                 },
                 itemStyle: {
                     color: '#49bcf7'
                 },
                 barWidth: '15',
                 data: [49, 80, 67, 99, 12, 19, 39, 84, 28, 47, 57, 100],
                 z: 10
             }, {
                 type: 'bar',
                 barGap: '-100%',
                 itemStyle: {
                     color: '#fff',
                     opacity: 0.1
                 },
                 barWidth: '15',
                 data: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
                 z: 5
             }],
         };
         // 使用刚指定的配置项和数据显示图表。
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }


     function zb1() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('zb1'));
         var v1 = zb1_data.v1 //男消费
         var v2 = zb1_data.v2 //女消费
         v2 = todayOpen();
         var v3 = v1 + v2 //总消费
         option = {
             series: [{
                 type: 'pie',
                 radius: ['60%', '70%'],
                 color: '#49bcf7',
                 label: {
                     normal: {
                         position: 'center'
                     }
                 },
                 data: [{
                     value: v2,
                     name: '女消费',
                     label: {
                         normal: {
                             formatter: v2 + '',
                             textStyle: {
                                 fontSize: 20,
                                 color: '#fff',
                             }
                         }
                     }
                 }, {
                     value: v1,
                     name: '男消费',
                     label: {
                         normal: {
                             formatter: function(params) {
                                 return '占比' + Math.round(v2 / v3 * 100) + '%'
                             },
                             textStyle: {
                                 color: '#aaa',
                                 fontSize: 12
                             }
                         }
                     },
                     itemStyle: {
                         normal: {
                             color: 'rgba(255,255,255,.2)'
                         },
                         emphasis: {
                             color: '#fff'
                         }
                     },
                 }]
             }]
         };
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function zb2() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('zb2'));
         var v1 = zb2_data.v1 //男消费
         var v2 = zb2_data.v2 //女消费
         v1 = CardSend();
         var v3 = v1 + v2 //总消费
         option = {

             //animation: false,
             series: [{
                 type: 'pie',
                 radius: ['60%', '70%'],
                 color: '#cdba00',
                 label: {
                     normal: {
                         position: 'center'
                     }
                 },
                 data: [{
                     value: v1,
                     name: '男消费',
                     label: {
                         normal: {
                             formatter: v1 + '',
                             textStyle: {
                                 fontSize: 20,
                                 color: '#fff',
                             }
                         }
                     }
                 }, {
                     value: v2,
                     name: '女消费',
                     label: {
                         normal: {
                             formatter: function(params) {
                                 return '占比' + Math.round(v1 / v3 * 100) + '%'
                             },
                             textStyle: {
                                 color: '#aaa',
                                 fontSize: 12
                             }
                         }
                     },
                     itemStyle: {
                         normal: {
                             color: 'rgba(255,255,255,.2)'
                         },
                         emphasis: {
                             color: '#fff'
                         }
                     },
                 }]
             }]
         };
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function zb3() {
         // 基于准备好的dom，初始化echarts实例
         var myChart = echarts.init(document.getElementById('zb3'));
         var v1 = 298 //男消费
         var v2 = SecondSale(); //女消费
         var v3 = v1 + v2 //总消费
         option = {
             series: [{

                 type: 'pie',
                 radius: ['60%', '70%'],
                 color: '#62c98d',
                 label: {
                     normal: {
                         position: 'center'
                     }
                 },
                 data: [{
                     value: v2,
                     name: '女消费',
                     label: {
                         normal: {
                             formatter: v2 + '',
                             textStyle: {
                                 fontSize: 20,
                                 color: '#fff',
                             }
                         }
                     }
                 }, {
                     value: v1,
                     name: '男消费',
                     label: {
                         normal: {
                             formatter: function(params) {
                                 return '占比' + Math.round(v2 / v3 * 100) + '%'
                             },
                             textStyle: {
                                 color: '#aaa',
                                 fontSize: 12
                             }
                         }
                     },
                     itemStyle: {
                         normal: {
                             color: 'rgba(255,255,255,.2)'
                         },
                         emphasis: {
                             color: '#fff'
                         }
                     },
                 }]
             }]
         };
         myChart.setOption(option);
         window.addEventListener("resize", function() {
             myChart.resize();
         });
     }

     function echarts_40() {
        var myChart = echarts.init(document.getElementById('echart40'));
        var data = [
            {name: '深圳', value: 215},
            {name: '哈尔滨', value: 112},
            {name: '郑州', value: 112},
            {name: '成都', value: 112},
            {name: '重庆', value: 112},
            {name: '长沙', value: 124},
            {name: '杭州', value: 110},
            {name: '济南', value: 110},
            {name: '长春', value: 110},
            {name: '太原', value: 110},
            {name: '西宁', value: 110},
            {name: '天津', value: 110},
       ];
       var geoCoordMap = {
           '深圳':[114.07,22.62],
           '哈尔滨':[126.63,45.75],
           '郑州':[113.65,34.76],
           '成都':[104.06,30.67],
           '重庆':[106.54,29.59],
           '长沙':[113.00,28.21],
           '杭州':[120.19,30.26],
           '济南':[117,36.65],
           '长春':[125.35,43.88],
           '太原':[112.53,37.87],
           '西宁':[101.74,36.56],
           '天津':[117.2,39.13],
       };
       var convertData = function (data) {
           var res = [];
           for (var i = 0; i < data.length; i++) {
               var geoCoord = geoCoordMap[data[i].name];
               if (geoCoord) {
                   res.push({
                       name: data[i].name,
                       value: geoCoord.concat(data[i].value)
                   });
               }
           }
           return res;
       };
       
       option = {
          // backgroundColor: '#404a59',
         /***  title: {
               text: '实时行驶车辆',
               subtext: 'data from PM25.in',
               sublink: 'http://www.pm25.in',
               left: 'center',
               textStyle: {
                   color: '#fff'
               }
           },**/
           tooltip : {
               trigger: 'item',
               formatter: function (params) {
                     if(typeof(params.value)[2] == "undefined"){
                         return params.name + ' : ' + params.value;
                     }else{
                         return params.name + ' : ' + params.value[2];
                     }
                   }
           },
           geo: {
               map: 'china',
               label: {
                   emphasis: {
                       show: false
                   }
               },
               roam: false,//禁止其放大缩小
               itemStyle: {
                   normal: {
                       areaColor: '#4c60ff',
                       borderColor: '#002097'
                   },
                   emphasis: {
                       areaColor: '#293fff'
                   }
               }
           },
           series : [
               {
                   name: '消费金额',
                   type: 'scatter',
                   coordinateSystem: 'geo',
                   data: convertData(data),
                   symbolSize: function (val) {
                       return val[2] / 15;
                   },
                   label: {
                       normal: {
                           formatter: '{b}',
                           position: 'right',
                           show: true
                       },
                       emphasis: {
                           show: true
                       }
                   },
                   itemStyle: {
                       normal: {
                           color: '#ffeb7b'
                       }
                   }
               }
               
               /**
               ,
               {
                   name: 'Top 5',
                   type: 'effectScatter',
                   coordinateSystem: 'geo',
                   data: convertData(data.sort(function (a, b) {
                       return b.value - a.value;
                   }).slice(0, 6)),
                   symbolSize: function (val) {
                       return val[2] / 20;
                   },
                   showEffectOn: 'render',
                   rippleEffect: {
                       brushType: 'stroke'
                   },
                   hoverAnimation: true,
                   label: {
                       normal: {
                           formatter: '{b}',
                           position: 'right',
                           show: true
                       }
                   },
                   itemStyle: {
                       normal: {
                           color: '#ffd800',
                           shadowBlur: 10,
                           shadowColor: 'rgba(0,0,0,.3)'
                       }
                   },
                   zlevel: 1
               }
               **/
           ]
       };
        
        myChart.setOption(option);
        window.addEventListener("resize",function(){
            myChart.resize();
        });
     }
 })
